package com.boomsecret.demo;

import com.boomsecret.utils.HttpUtils;
import com.boomsecret.utils.PatternUtils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Created by wangjinliang on 2018/1/9.
 */
public class EmailRegexDemo {

    private static final String TARGET_URL = "http://tieba.baidu.com/p/2314539885";

    public static void main(String[] args) {
        try {
            String content = HttpUtils.get(TARGET_URL, null);
            Matcher matcher = Pattern.compile(PatternUtils.EMAIL_REGEX).matcher(content);
            while (matcher.find()) {
                System.out.println(matcher.group());
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
